package LeetCode.month04.day108;

import java.util.Arrays;

/**
 * @author 16778
 * @date 2025/11/18 9:46
 * @description
 */
public class No717 {
    public boolean isOneBitCharacter(int[] bits) {
        int n = bits.length;
        if(n==1) return true;
        if(bits[n-2]==0) return true;
        int[] arr = Arrays.copyOf(bits, n - 2);
        int num = 0;
        for (int i = 0; i < n - 2; i++) {
            if(arr[i]==0){
                num = 0;
            }else{
                num++;
            }
        }
        if(num%2==1) return true;
        return false;
    }
}
